package javamail;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class SendMailServlet extends HttpServlet {

	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		// TODO Auto-generated method stub
		
		PrintWriter out = resp.getWriter();
		
		
		//List list =  Arrays.asList(recipient);
		//req.setAttribute("recipient", list); 
		String subject=req.getParameter("subject");
		String recipient[]=req.getParameterValues("recipient");
		String message=req.getParameter("message"); 
		Mail mail = new Mail();
		
		
		
		mail.sendMail(subject, recipient, message);

	}

}
